package com.gexin.model.activity;

import com.gexin.model.activity.base.BaseMemberBillShopLog;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;

/**
 * 业务名称:  t_member_bill_shop_log() 
 */
@SuppressWarnings("serial")
public class MemberBillShopLog extends BaseMemberBillShopLog<MemberBillShopLog> {
	public static final MemberBillShopLog dao = new MemberBillShopLog();






	public void setCommonUserIdAndPresentIdAndbillAndIncomeOrAndIncrementAndDesc(
			String userId, String presentId,String mainPresentId, int type,
			BigDecimal billOfShop, BigDecimal increment,int incomeor,String desc){
		this.setId(System.currentTimeMillis()/1000+"");
		this.setUserId(userId);
		this.setPresentId(presentId);
		this.setMainPresentId(mainPresentId);
		this.setBillOfShopping(billOfShop);
		this.setIncrement(increment);
		this.setIncomeOr(incomeor);
		this.setDesc(desc);
		this.setType(type);
		long date = new Date().getTime();
		this.setCreateTime(date);
		this.setUpdateTime(date);
	}

	/*--------------------------------------------------------------------------------------------------------------------*/
	public List<MemberBillShopLog> findByUserId(String id) {
		List<MemberBillShopLog> memberBillShopLogs = MemberBillShopLog.dao.find("select * from t_member_bill_shop_log where user_id=" + id);
		return memberBillShopLogs;
	}



}
